class: center, middle, inverse, title-slide .title[ # Advanced quantitative methods tutorial week 1 ] .author[ ### Rasmus Klokker ] --- class: center, middle # About me .pull-left[BA and MSC from Department of Sociology, University of Copenhagen(graduated 2016)] .center[ <img src="data:image/png;base64,#https://designguide.ku.dk/download/co-branding/ku_logo_dk_hh.png" width="100px" /> ] <br /> .pull-left[Worked at VIVE - The Danish Center for Social Science Research since 2016] .center[ <img src="data:image/png;base64,#https://silkeborgbib.dk/sites/silkeborg.ddbcms.dk/files/styles/ding_secondary_large/public/title_image/eresource/vive_-_stor.png?itok=2xRibkp-" width="100px" /> ] <br /> .pull-left[Worked a lot with systematic litterature review and meta-analysis] .center[ <img src="data:image/png;base64,#week-1-intro_files/figure-html/unnamed-chunk-3-1.png" width="300px" /> ] --- # About me Currently a Ph.D student jointly at VIVE and Department of Sociology Works on teacher sorting and teacher mobility .pull-left[
] .pull-right[ <div class="figure"> <img src="data:image/png;base64,#schooldistplot.png" alt="change in distance to nearest teacher training college(TTC) after 11 TTCs closed down" width="500px" /> <p class="caption">change in distance to nearest teacher training college(TTC) after 11 TTCs closed down</p> </div> ] --- # Any questions about the lecture? --- # what was the hardest thing you had to learn in stats I? 5 min discussion with partner(s) group discussion afterwards --- # Break 15 mins!  --- # What would you like the tutorials to be about 5 min discussion with partner(s) group discussion afterwards ## Last time was... What was nice and not so nice about the tutorials last time? ## This time around we'd like more.. Going over hard stuff from lectures/texts one(or ten) more time(s)? Doing practical stuff in R? Something else? --- # What are you going to be learning this time --- ## Multiple regression Powerful!! Now you can adjust for confounders that would otherwise bias your estimate!
--- ### in R ```r lm.naive <- lm(salary~education, data=df) lm.adjust <- lm(salary~education+cul_cap, data=df) ``` Because we cheated and made up some data, we know that the true effect of education on salary is 10. But if we estimate a naive association between salary and education the estimate of the effect is 12.2730921. if we adjust for cultural capital of parents, the estimated effect is 10.0027865 --- ### Polynomial terms Linear regression assumes that associations are linear, i.e. a straight line but what if they are not linear? What if the association actually looks like this? <img src="data:image/png;base64,#week-1-intro_files/figure-html/poly_plot-1.png" width="400px" /> --- Then we'd need a model with a polynomial term. In practial sense that means that we include `\(x^2\)` in the model like this ### in R ```r lm.lin <- lm(y~x, data=df) lm.poly <- lm(y~x+I(x^2), data=df) ``` --- The red line is the model with only `\(x\)` and the green curve is from the model that also includes `\(x^2\)`. Including `\(x^2\)` was clearly a good choice <!-- --> --- ### Interaction terms What if the effect of something is not the same for everyone? What if getting a college degree is more impactful for people from a working class background than those from an affluent background? .pull-left[ <img src="data:image/png;base64,#week-1-intro_files/figure-html/int_plot-1.png" width="400px" /> ] .pull-right[ ### in R ```r lm.int <- lm(salary~education+class+class*education, data=df) ``` ] --- ## Causal inference --- ### Randomized controlled trials The gold standard! Nearly a requirement in medical sciences, but not so much in social science. They are becoming more popular however <!--  --> <div class="figure"> <img src="data:image/png;base64,#rct_education.png" alt="Number of RCTs in education research Connolly, Paul, Ciara Keenan, and Karolina Urbanska. "The trials of evidence-based practice in education: A systematic review of randomised controlled trials in education research 1980–2016." Educational Research 60.3 (2018): 276-291." width="500px" /> <p class="caption">Number of RCTs in education research Connolly, Paul, Ciara Keenan, and Karolina Urbanska. "The trials of evidence-based practice in education: A systematic review of randomised controlled trials in education research 1980–2016." Educational Research 60.3 (2018): 276-291.</p> </div> Yields, on average, an unbiased estimate with minimal assumptions --- ### Instrumental variable(IV) What if you can't do an RCT? For some reason, no one wants to fund a study in which we randomly select teenagers to pick up smoking. Maybe there is a different way to go about it?
--- <!--  --> <img src="data:image/png;base64,#ea_iv.png" width="500px" />
### in R --- ### Regression discontinuity Like IV, a method that utilizes "natural experiments". This method relies on some kind of "cutoff" that determines who gets "treated" and who do not The central idea is that, individuals close just above and just below the cutoff can function as treatment and control groups e.g. GPA threshold for college admissions in DK  --- ## (Applied) statistical (analysis) literacy --- ### Correlation is not causation .pull-left[ [Rapport om indvandreres ægteskaber kløjes i svar på, hvordan det går med integrationen](https://www.tjekdet.dk/faktatjek/rapport-om-indvandreres-aegteskaber-kloejes-i-svar-paa-hvordan-det-gaar-med-integrationen) <!--  --> <img src="data:image/png;base64,#unitos 1.png" width="500px" /> <!--  --> <img src="data:image/png;base64,#unitos 2.png" width="500px" /> ] .pull-right[ [Partileder ført på afveje af kringlet sætning om unge kriminelle indvandrere](https://www.tjekdet.dk/faktatjek/partileder-foert-paa-afveje-af-kringlet-saetning-om-unge-kriminelle-indvandrere) <!--  --> <img src="data:image/png;base64,#sikandar 1.png" width="500px" /> <!--  --> <img src="data:image/png;base64,#sikandar 2.png" width="500px" /> ] --- ### All models are wrong and all estimates are uncertain .center[_All models are wrong, but some are useful_] .center[George Box] <!--  --> <img src="data:image/png;base64,#floor-plan.jpg" width="500px" /> --- <!--  --> <img src="data:image/png;base64,#danmask 1.png" width="500px" /> <!--  --> <img src="data:image/png;base64,#danmask 2.jpg" width="500px" /> --- <!-- {width=250px} --> <img src="data:image/png;base64,#la sikker.png" width="700px" /> --- .left[] --- .center[] --- .right[] --- # That's it, see you next week!! ## Any questions outside tutorials? rhk@vive.dk rhk@soc.ku.dk